import request from '@utils/request'

// 查询维修单信息
export function getForm (data) {
  return request({
    url: '/repairOrder/getPageList',
    method: 'post',
    data: data,
    headers: {
      'Content-Type': 'application/json',
      'Authorization': window.localStorage.getItem('token'),
    }
  })
}
// 查询不同校区报修单
export function getOrderType (data) {
  return request({
    url: '/repairOrder/getOrderCount',
    method: 'get',
    data: data,
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded',
      'Authorization': window.localStorage.getItem('token'),
    }
  })
}
// 查询报修单满意度
export function getEvaluationCount (data) {
  return request({
    url: '/evaluation/getEvaluationCount',
    method: 'get',
    data: data,
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded',
      'Authorization': window.localStorage.getItem('token'),
    }
  })
}
// 查询近七天报修单
export function getOrderCountByTime (data) {
  return request({
    url: '/repairOrder/getOrderCountByTime',
    method: 'post',
    data: data,
    headers: {
      'Content-Type': 'application/json',
      'Authorization': window.localStorage.getItem('token'),
    }
  })
}
// 导出维修单信息
export function exportForm (data) {
  return request({
    url: '/repairOrder/export',
    method: 'post',
    data: data,
    responseType: 'blob',
    headers: {
      'Content-Type': 'application/json',
      'Authorization': window.localStorage.getItem('token'),
    }
  })
}
// 下载模板
export function downLoad (data) {
  return request({
    url: '/repairOrder/downLoadExcel',
    method: 'post',
    data: data,
    responseType: 'blob',
    headers: {
      'Content-Type': 'application/json',
      'Authorization': window.localStorage.getItem('token'),
    }
  })
}

// 导入维修单信息
export function uploadMaintain (data) {
  return request({
    url: '/repairOrder/uploadIn',
    method: 'post',
    data: data,
    headers: {
      'Content-Type': 'multipart/form-data',
      'Authorization': window.localStorage.getItem('token'),
    }
  })
}

// 查看转单
export function lookDetail (data) {
  return request({
    url: '/transferOrder/getList',
    method: 'get',
    params: data,
    headers: {
      // 'Content-Type': 'application/json',
      'Content-Type': 'application/x-www-form-urlencoded',
      'Authorization': window.localStorage.getItem('token'),
    }
  })
}

// 导出转单
export function exportTransmit (data) {
  return request({
    url: '/transferOrder/export?ids='+data,
    method: 'get',
    params: data,
    responseType: 'blob',
    headers: {
      // 'Content-Type': 'application/json',
      'Content-Type': 'application/x-www-form-urlencoded',

      'Authorization': window.localStorage.getItem('token'),
    }
  })
}

// 删除报修单
export function delRepairOrder (data) {
  return request({
    url: '/repairOrder/delRepairOrder',
    method: 'get',
    params: data,
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded',
      'Authorization': window.localStorage.getItem('token'),
    }
  })
}